In [1]:
    
import pandas as pd
    
In [23]:
    
df = pd.read_json("http://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2000-02-11")
df2 = pd.read_json("http://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2000-02-12")
    
In [4]:
    
df
    
    Out[4]:
  
    
       
      results 
      status 
     
  
  
    
      astronomical_twilight_begin 
      5:43:04 AM 
      OK 
     
    
      astronomical_twilight_end 
      7:20:46 PM 
      OK 
     
    
      civil_twilight_begin 
      6:43:42 AM 
      OK 
     
    
      civil_twilight_end 
      6:20:09 PM 
      OK 
     
    
      day_length 
      10:43:17 
      OK 
     
    
      nautical_twilight_begin 
      6:13:13 AM 
      OK 
     
    
      nautical_twilight_end 
      6:50:38 PM 
      OK 
     
    
      solar_noon 
      12:31:55 PM 
      OK 
     
    
      sunrise 
      7:10:17 AM 
      OK 
     
    
      sunset 
      5:53:34 PM 
      OK 
     
  
In [29]:
    
time1 = df.loc["day_length"]["results"]
time1.split(":")
    
    Out[29]:
['10', '43', '17']
In [37]:
    
i = 0
j = 1
foo = pd.DataFrame()
foo.loc[i, "daylight_time"] = 10
foo.loc[j, "daylight_time"] = 20
foo
    
    Out[37]:
  
    
       
      daylight_time 
     
  
  
    
      0 
      10.0 
     
    
      1 
      20.0 
     
  
In [12]:
    
try:
    df2 = pd.read_json("http://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2000-02-2")
except ValueError:
    print("foobar")
    
In [12]:
    
apiStem = "http://api.sunrise-sunset.org/json?"
latitude = "lat=47.606209&"
longitude = "lng=-122.332069&"
location = apiStem +  latitude + longitude + "date="
yearStart = 2011
yearEnd = 2018
monthStart = 1
monthEnd = 13
dayStart = 1
dayEnd = 32
    
In [56]:
    
result = pd.DataFrame()
i = 0
for year in range(yearStart, yearEnd):
    for month in range (monthStart, monthEnd):
        for day in range (dayStart, dayEnd):
            apiURL = location + str(year) + '-' + str(month) + '-' + str(day)
            try:
                parsedJSON = pd.read_json(apiURL)
                daylightLength = parsedJSON.loc["day_length"]["results"]
                hms = daylightLength.split(":")
                timeInSecs = int(hms[0])*60*60 + int(hms[1])*60 + int(hms[2])
                result.loc[i, "year"] = year
                result.loc[i, "month"] = month
                result.loc[i, "day"] = day
                result.loc[i, "daylight_seconds"] = timeInSecs
            except ValueError:
                #Date is not available; do nothing
                pass
            i += 1
result
    
    Out[56]:
  
    
       
      year 
      month 
      day 
      daylight_seconds 
     
  
  
    
      0 
      2011.0 
      1.0 
      1.0 
      30686.0 
     
    
      1 
      2011.0 
      1.0 
      2.0 
      30750.0 
     
    
      2 
      2011.0 
      1.0 
      3.0 
      30818.0 
     
    
      3 
      2011.0 
      1.0 
      4.0 
      30891.0 
     
    
      4 
      2011.0 
      1.0 
      5.0 
      30969.0 
     
    
      5 
      2011.0 
      1.0 
      6.0 
      31051.0 
     
    
      6 
      2011.0 
      1.0 
      7.0 
      31138.0 
     
    
      7 
      2011.0 
      1.0 
      8.0 
      31231.0 
     
    
      8 
      2011.0 
      1.0 
      9.0 
      31326.0 
     
    
      9 
      2011.0 
      1.0 
      10.0 
      31427.0 
     
    
      10 
      2011.0 
      1.0 
      11.0 
      31532.0 
     
    
      11 
      2011.0 
      1.0 
      12.0 
      31642.0 
     
    
      12 
      2011.0 
      1.0 
      13.0 
      31756.0 
     
    
      13 
      2011.0 
      1.0 
      14.0 
      31873.0 
     
    
      14 
      2011.0 
      1.0 
      15.0 
      31994.0 
     
    
      15 
      2011.0 
      1.0 
      16.0 
      32120.0 
     
    
      16 
      2011.0 
      1.0 
      17.0 
      32248.0 
     
    
      17 
      2011.0 
      1.0 
      18.0 
      32381.0 
     
    
      18 
      2011.0 
      1.0 
      19.0 
      32516.0 
     
    
      19 
      2011.0 
      1.0 
      20.0 
      32656.0 
     
    
      20 
      2011.0 
      1.0 
      21.0 
      32798.0 
     
    
      21 
      2011.0 
      1.0 
      22.0 
      32944.0 
     
    
      22 
      2011.0 
      1.0 
      23.0 
      33094.0 
     
    
      23 
      2011.0 
      1.0 
      24.0 
      33245.0 
     
    
      24 
      2011.0 
      1.0 
      25.0 
      33400.0 
     
    
      25 
      2011.0 
      1.0 
      26.0 
      33557.0 
     
    
      26 
      2011.0 
      1.0 
      27.0 
      33717.0 
     
    
      27 
      2011.0 
      1.0 
      28.0 
      33880.0 
     
    
      28 
      2011.0 
      1.0 
      29.0 
      34046.0 
     
    
      29 
      2011.0 
      1.0 
      30.0 
      34213.0 
     
    
      ... 
      ... 
      ... 
      ... 
      ... 
     
    
      2574 
      2017.0 
      12.0 
      2.0 
      31224.0 
     
    
      2575 
      2017.0 
      12.0 
      3.0 
      31134.0 
     
    
      2576 
      2017.0 
      12.0 
      4.0 
      31047.0 
     
    
      2577 
      2017.0 
      12.0 
      5.0 
      30965.0 
     
    
      2578 
      2017.0 
      12.0 
      6.0 
      30887.0 
     
    
      2579 
      2017.0 
      12.0 
      7.0 
      30815.0 
     
    
      2580 
      2017.0 
      12.0 
      8.0 
      30748.0 
     
    
      2581 
      2017.0 
      12.0 
      9.0 
      30685.0 
     
    
      2582 
      2017.0 
      12.0 
      10.0 
      30628.0 
     
    
      2583 
      2017.0 
      12.0 
      11.0 
      30575.0 
     
    
      2584 
      2017.0 
      12.0 
      12.0 
      30528.0 
     
    
      2585 
      2017.0 
      12.0 
      13.0 
      30485.0 
     
    
      2586 
      2017.0 
      12.0 
      14.0 
      30449.0 
     
    
      2587 
      2017.0 
      12.0 
      15.0 
      30417.0 
     
    
      2588 
      2017.0 
      12.0 
      16.0 
      30391.0 
     
    
      2589 
      2017.0 
      12.0 
      17.0 
      30370.0 
     
    
      2590 
      2017.0 
      12.0 
      18.0 
      30355.0 
     
    
      2591 
      2017.0 
      12.0 
      19.0 
      30345.0 
     
    
      2592 
      2017.0 
      12.0 
      20.0 
      30340.0 
     
    
      2593 
      2017.0 
      12.0 
      21.0 
      30341.0 
     
    
      2594 
      2017.0 
      12.0 
      22.0 
      30347.0 
     
    
      2595 
      2017.0 
      12.0 
      23.0 
      30359.0 
     
    
      2596 
      2017.0 
      12.0 
      24.0 
      30377.0 
     
    
      2597 
      2017.0 
      12.0 
      25.0 
      30400.0 
     
    
      2598 
      2017.0 
      12.0 
      26.0 
      30427.0 
     
    
      2599 
      2017.0 
      12.0 
      27.0 
      30460.0 
     
    
      2600 
      2017.0 
      12.0 
      28.0 
      30499.0 
     
    
      2601 
      2017.0 
      12.0 
      29.0 
      30543.0 
     
    
      2602 
      2017.0 
      12.0 
      30.0 
      30592.0 
     
    
      2603 
      2017.0 
      12.0 
      31.0 
      30647.0 
     
  
2557 rows × 4 columns
In [57]:
    
result
    
    Out[57]:
  
    
       
      year 
      month 
      day 
      daylight_seconds 
     
  
  
    
      0 
      2011.0 
      1.0 
      1.0 
      30686.0 
     
    
      1 
      2011.0 
      1.0 
      2.0 
      30750.0 
     
    
      2 
      2011.0 
      1.0 
      3.0 
      30818.0 
     
    
      3 
      2011.0 
      1.0 
      4.0 
      30891.0 
     
    
      4 
      2011.0 
      1.0 
      5.0 
      30969.0 
     
    
      5 
      2011.0 
      1.0 
      6.0 
      31051.0 
     
    
      6 
      2011.0 
      1.0 
      7.0 
      31138.0 
     
    
      7 
      2011.0 
      1.0 
      8.0 
      31231.0 
     
    
      8 
      2011.0 
      1.0 
      9.0 
      31326.0 
     
    
      9 
      2011.0 
      1.0 
      10.0 
      31427.0 
     
    
      10 
      2011.0 
      1.0 
      11.0 
      31532.0 
     
    
      11 
      2011.0 
      1.0 
      12.0 
      31642.0 
     
    
      12 
      2011.0 
      1.0 
      13.0 
      31756.0 
     
    
      13 
      2011.0 
      1.0 
      14.0 
      31873.0 
     
    
      14 
      2011.0 
      1.0 
      15.0 
      31994.0 
     
    
      15 
      2011.0 
      1.0 
      16.0 
      32120.0 
     
    
      16 
      2011.0 
      1.0 
      17.0 
      32248.0 
     
    
      17 
      2011.0 
      1.0 
      18.0 
      32381.0 
     
    
      18 
      2011.0 
      1.0 
      19.0 
      32516.0 
     
    
      19 
      2011.0 
      1.0 
      20.0 
      32656.0 
     
    
      20 
      2011.0 
      1.0 
      21.0 
      32798.0 
     
    
      21 
      2011.0 
      1.0 
      22.0 
      32944.0 
     
    
      22 
      2011.0 
      1.0 
      23.0 
      33094.0 
     
    
      23 
      2011.0 
      1.0 
      24.0 
      33245.0 
     
    
      24 
      2011.0 
      1.0 
      25.0 
      33400.0 
     
    
      25 
      2011.0 
      1.0 
      26.0 
      33557.0 
     
    
      26 
      2011.0 
      1.0 
      27.0 
      33717.0 
     
    
      27 
      2011.0 
      1.0 
      28.0 
      33880.0 
     
    
      28 
      2011.0 
      1.0 
      29.0 
      34046.0 
     
    
      29 
      2011.0 
      1.0 
      30.0 
      34213.0 
     
    
      ... 
      ... 
      ... 
      ... 
      ... 
     
    
      2574 
      2017.0 
      12.0 
      2.0 
      31224.0 
     
    
      2575 
      2017.0 
      12.0 
      3.0 
      31134.0 
     
    
      2576 
      2017.0 
      12.0 
      4.0 
      31047.0 
     
    
      2577 
      2017.0 
      12.0 
      5.0 
      30965.0 
     
    
      2578 
      2017.0 
      12.0 
      6.0 
      30887.0 
     
    
      2579 
      2017.0 
      12.0 
      7.0 
      30815.0 
     
    
      2580 
      2017.0 
      12.0 
      8.0 
      30748.0 
     
    
      2581 
      2017.0 
      12.0 
      9.0 
      30685.0 
     
    
      2582 
      2017.0 
      12.0 
      10.0 
      30628.0 
     
    
      2583 
      2017.0 
      12.0 
      11.0 
      30575.0 
     
    
      2584 
      2017.0 
      12.0 
      12.0 
      30528.0 
     
    
      2585 
      2017.0 
      12.0 
      13.0 
      30485.0 
     
    
      2586 
      2017.0 
      12.0 
      14.0 
      30449.0 
     
    
      2587 
      2017.0 
      12.0 
      15.0 
      30417.0 
     
    
      2588 
      2017.0 
      12.0 
      16.0 
      30391.0 
     
    
      2589 
      2017.0 
      12.0 
      17.0 
      30370.0 
     
    
      2590 
      2017.0 
      12.0 
      18.0 
      30355.0 
     
    
      2591 
      2017.0 
      12.0 
      19.0 
      30345.0 
     
    
      2592 
      2017.0 
      12.0 
      20.0 
      30340.0 
     
    
      2593 
      2017.0 
      12.0 
      21.0 
      30341.0 
     
    
      2594 
      2017.0 
      12.0 
      22.0 
      30347.0 
     
    
      2595 
      2017.0 
      12.0 
      23.0 
      30359.0 
     
    
      2596 
      2017.0 
      12.0 
      24.0 
      30377.0 
     
    
      2597 
      2017.0 
      12.0 
      25.0 
      30400.0 
     
    
      2598 
      2017.0 
      12.0 
      26.0 
      30427.0 
     
    
      2599 
      2017.0 
      12.0 
      27.0 
      30460.0 
     
    
      2600 
      2017.0 
      12.0 
      28.0 
      30499.0 
     
    
      2601 
      2017.0 
      12.0 
      29.0 
      30543.0 
     
    
      2602 
      2017.0 
      12.0 
      30.0 
      30592.0 
     
    
      2603 
      2017.0 
      12.0 
      31.0 
      30647.0 
     
  
2557 rows × 4 columns
In [58]:
    
#First request timed out 2011-4-11
result.to_csv("secondRequest.csv")
    
Now want to get just the relevant dates for sample data
In [4]:
    
sampleData = pd.read_csv("sample_dates.csv")
    
In [5]:
    
sampleData
    
    Out[5]:
  
    
       
      Outage Start 
     
  
  
    
      0 
      1/1/2014 0:54 
     
    
      1 
      1/2/2014 7:42 
     
    
      2 
      1/3/2014 10:17 
     
    
      3 
      1/4/2014 3:05 
     
    
      4 
      1/4/2014 9:01 
     
    
      5 
      1/4/2014 10:58 
     
    
      6 
      1/5/2014 2:49 
     
    
      7 
      1/5/2014 6:55 
     
    
      8 
      1/5/2014 9:06 
     
    
      9 
      1/5/2014 10:06 
     
    
      10 
      1/5/2014 21:55 
     
    
      11 
      1/6/2014 16:46 
     
    
      12 
      1/6/2014 17:47 
     
    
      13 
      1/7/2014 4:35 
     
    
      14 
      1/7/2014 8:00 
     
    
      15 
      1/7/2014 9:31 
     
    
      16 
      1/9/2014 2:49 
     
    
      17 
      1/9/2014 9:55 
     
    
      18 
      1/10/2014 4:36 
     
    
      19 
      1/10/2014 22:33 
     
    
      20 
      1/11/2014 2:47 
     
    
      21 
      1/11/2014 3:10 
     
    
      22 
      1/11/2014 3:14 
     
    
      23 
      1/11/2014 3:49 
     
    
      24 
      1/11/2014 4:16 
     
    
      25 
      1/11/2014 4:24 
     
    
      26 
      1/11/2014 4:33 
     
    
      27 
      1/11/2014 4:42 
     
    
      28 
      1/11/2014 4:47 
     
    
      29 
      1/11/2014 5:24 
     
    
      ... 
      ... 
     
    
      1175 
      12/13/2014 22:55 
     
    
      1176 
      12/14/2014 8:41 
     
    
      1177 
      12/16/2014 12:04 
     
    
      1178 
      12/16/2014 13:17 
     
    
      1179 
      12/17/2014 8:03 
     
    
      1180 
      12/17/2014 13:17 
     
    
      1181 
      12/18/2014 0:01 
     
    
      1182 
      12/18/2014 10:03 
     
    
      1183 
      12/18/2014 14:45 
     
    
      1184 
      12/18/2014 17:07 
     
    
      1185 
      12/20/2014 3:48 
     
    
      1186 
      12/20/2014 8:27 
     
    
      1187 
      12/20/2014 13:52 
     
    
      1188 
      12/20/2014 22:06 
     
    
      1189 
      12/21/2014 6:15 
     
    
      1190 
      12/22/2014 13:21 
     
    
      1191 
      12/22/2014 15:08 
     
    
      1192 
      12/23/2014 10:39 
     
    
      1193 
      12/23/2014 11:06 
     
    
      1194 
      12/23/2014 23:22 
     
    
      1195 
      12/23/2014 23:38 
     
    
      1196 
      12/27/2014 9:10 
     
    
      1197 
      12/27/2014 11:00 
     
    
      1198 
      12/29/2014 0:53 
     
    
      1199 
      12/29/2014 10:48 
     
    
      1200 
      12/30/2014 2:35 
     
    
      1201 
      12/30/2014 17:15 
     
    
      1202 
      12/30/2014 20:46 
     
    
      1203 
      12/31/2014 13:52 
     
    
      1204 
      12/31/2014 21:10 
     
  
1205 rows × 1 columns
In [13]:
    
result = pd.DataFrame()
i = 0
for row in sampleData.itertuples():
    yearOnly = row[1].split(' ')
    dates = yearOnly[0].split('/')
    month = dates[0]
    day = dates[1]
    year = dates[2]
    apiURL = location + str(year) + '-' + str(month) + '-' + str(day)
    try:
        parsedJSON = pd.read_json(apiURL)
        daylightLength = parsedJSON.loc["day_length"]["results"]
        hms = daylightLength.split(":")
        timeInSecs = int(hms[0])*60*60 + int(hms[1])*60 + int(hms[2])
        result.loc[i, "year"] = year
        result.loc[i, "month"] = month
        result.loc[i, "day"] = day
        result.loc[i, "daylight_seconds"] = timeInSecs
    except ValueError:
        #Date is not available; do nothing
        pass
    i += 1
result
    
    Out[13]:
  
    
       
      year 
      month 
      day 
      daylight_seconds 
     
  
  
    
      0 
      2014 
      1 
      1 
      30704.0 
     
    
      1 
      2014 
      1 
      2 
      30768.0 
     
    
      2 
      2014 
      1 
      3 
      30837.0 
     
    
      3 
      2014 
      1 
      4 
      30911.0 
     
    
      4 
      2014 
      1 
      4 
      30911.0 
     
    
      5 
      2014 
      1 
      4 
      30911.0 
     
    
      6 
      2014 
      1 
      5 
      30990.0 
     
    
      7 
      2014 
      1 
      5 
      30990.0 
     
    
      8 
      2014 
      1 
      5 
      30990.0 
     
    
      9 
      2014 
      1 
      5 
      30990.0 
     
    
      10 
      2014 
      1 
      5 
      30990.0 
     
    
      11 
      2014 
      1 
      6 
      31074.0 
     
    
      12 
      2014 
      1 
      6 
      31074.0 
     
    
      13 
      2014 
      1 
      7 
      31163.0 
     
    
      14 
      2014 
      1 
      7 
      31163.0 
     
    
      15 
      2014 
      1 
      7 
      31163.0 
     
    
      16 
      2014 
      1 
      9 
      31354.0 
     
    
      17 
      2014 
      1 
      9 
      31354.0 
     
    
      18 
      2014 
      1 
      10 
      31456.0 
     
    
      19 
      2014 
      1 
      10 
      31456.0 
     
    
      20 
      2014 
      1 
      11 
      31562.0 
     
    
      21 
      2014 
      1 
      11 
      31562.0 
     
    
      22 
      2014 
      1 
      11 
      31562.0 
     
    
      23 
      2014 
      1 
      11 
      31562.0 
     
    
      24 
      2014 
      1 
      11 
      31562.0 
     
    
      25 
      2014 
      1 
      11 
      31562.0 
     
    
      26 
      2014 
      1 
      11 
      31562.0 
     
    
      27 
      2014 
      1 
      11 
      31562.0 
     
    
      28 
      2014 
      1 
      11 
      31562.0 
     
    
      29 
      2014 
      1 
      11 
      31562.0 
     
    
      ... 
      ... 
      ... 
      ... 
      ... 
     
    
      1175 
      2014 
      12 
      13 
      30496.0 
     
    
      1176 
      2014 
      12 
      14 
      30458.0 
     
    
      1177 
      2014 
      12 
      16 
      30398.0 
     
    
      1178 
      2014 
      12 
      16 
      30398.0 
     
    
      1179 
      2014 
      12 
      17 
      30375.0 
     
    
      1180 
      2014 
      12 
      17 
      30375.0 
     
    
      1181 
      2014 
      12 
      18 
      30358.0 
     
    
      1182 
      2014 
      12 
      18 
      30358.0 
     
    
      1183 
      2014 
      12 
      18 
      30358.0 
     
    
      1184 
      2014 
      12 
      18 
      30358.0 
     
    
      1185 
      2014 
      12 
      20 
      30341.0 
     
    
      1186 
      2014 
      12 
      20 
      30341.0 
     
    
      1187 
      2014 
      12 
      20 
      30341.0 
     
    
      1188 
      2014 
      12 
      20 
      30341.0 
     
    
      1189 
      2014 
      12 
      21 
      30340.0 
     
    
      1190 
      2014 
      12 
      22 
      30344.0 
     
    
      1191 
      2014 
      12 
      22 
      30344.0 
     
    
      1192 
      2014 
      12 
      23 
      30355.0 
     
    
      1193 
      2014 
      12 
      23 
      30355.0 
     
    
      1194 
      2014 
      12 
      23 
      30355.0 
     
    
      1195 
      2014 
      12 
      23 
      30355.0 
     
    
      1196 
      2014 
      12 
      27 
      30451.0 
     
    
      1197 
      2014 
      12 
      27 
      30451.0 
     
    
      1198 
      2014 
      12 
      29 
      30530.0 
     
    
      1199 
      2014 
      12 
      29 
      30530.0 
     
    
      1200 
      2014 
      12 
      30 
      30578.0 
     
    
      1201 
      2014 
      12 
      30 
      30578.0 
     
    
      1202 
      2014 
      12 
      30 
      30578.0 
     
    
      1203 
      2014 
      12 
      31 
      30631.0 
     
    
      1204 
      2014 
      12 
      31 
      30631.0 
     
  
1205 rows × 4 columns
In [15]:
    
result.to_csv("sample_daylightTimes.csv")
    
In [ ]:
    
    
In [18]:
    
from urllib import request
import json
    
In [36]:
    
foo, forecast = pd.read_json("http://api.wunderground.com/api/e93b3134aaec556a/forecast/q/WA/Seattle.json")
    
In [39]:
    
forecast
    
    Out[39]:
'response'
In [33]:
    
f = request.urlopen('http://api.wunderground.com/api/e93b3134aaec556a/forecast/q/WA/Seattle.json')
    
In [35]:
    
json_string = f.read()
parsed_json = json.loads(json_string)
# location = parsed_json['location']['city']
# temp_f = parsed_json['current_observation']['temp_f']
# print "Current temperature in %s is: %s" % (location, temp_f)
# f.close()
    
    
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-35-bde3a531ce97> in <module>()
      1 json_string = f.read()
----> 2 parsed_json = json.loads(json_string)
      3 # location = parsed_json['location']['city']
      4 # temp_f = parsed_json['current_observation']['temp_f']
      5 # print "Current temperature in %s is: %s" % (location, temp_f)
C:\Users\Ryan Kastilani\Miniconda3\lib\json\__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    310     if not isinstance(s, str):
    311         raise TypeError('the JSON object must be str, not {!r}'.format(
--> 312                             s.__class__.__name__))
    313     if s.startswith(u'\ufeff'):
    314         raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
TypeError: the JSON object must be str, not 'bytes'
In [31]:
    
json_string
    
    Out[31]:
b'\n{\n  "response": {\n  "version":"0.1",\n  "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",\n  "features": {\n  "forecast": 1\n  }\n\t}\n\t\t,\n\t"forecast":{\n\t\t"txt_forecast": {\n\t\t"date":"9:29 PM PDT",\n\t\t"forecastday": [\n\t\t{\n\t\t"period":0,\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"title":"Monday",\n\t\t"fcttext":"Cloudy with rain. Lows overnight in the upper 40s.",\n\t\t"fcttext_metric":"Periods of rain late. Low 9C.",\n\t\t"pop":"90"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":1,\n\t\t"icon":"nt_rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/nt_rain.gif",\n\t\t"title":"Monday Night",\n\t\t"fcttext":"Periods of rain. Low 47F. Winds light and variable. Chance of rain 90%. Rainfall near a quarter of an inch.",\n\t\t"fcttext_metric":"Cloudy with rain developing after midnight. Low 9C. Winds light and variable. Chance of rain 90%. Rainfall near 6mm.",\n\t\t"pop":"90"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":2,\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"title":"Tuesday",\n\t\t"fcttext":"A steady rain in the morning. Showers continuing in the afternoon. High around 55F. Winds S at 10 to 15 mph. Chance of rain 80%.",\n\t\t"fcttext_metric":"Steady light rain in the morning. Showers continuing in the afternoon. High 13C. Winds S at 15 to 25 km/h. Chance of rain 80%.",\n\t\t"pop":"80"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":3,\n\t\t"icon":"nt_rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/nt_rain.gif",\n\t\t"title":"Tuesday Night",\n\t\t"fcttext":"Rain. Low 48F. Winds S at 10 to 15 mph. Chance of rain 80%. Rainfall near a quarter of an inch.",\n\t\t"fcttext_metric":"Rain. Low 9C. Winds S at 10 to 15 km/h. Chance of rain 80%. Rainfall near 6mm.",\n\t\t"pop":"80"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":4,\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"title":"Wednesday",\n\t\t"fcttext":"Rain early...then remaining cloudy with showers in the afternoon. High 52F. Winds SSE at 10 to 15 mph. Chance of rain 90%. Rainfall near a quarter of an inch.",\n\t\t"fcttext_metric":"A steady rain in the morning. Showers continuing in the afternoon. High 11C. Winds SSE at 10 to 15 km/h. Chance of rain 90%. Rainfall around 6mm.",\n\t\t"pop":"90"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":5,\n\t\t"icon":"nt_chancerain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",\n\t\t"title":"Wednesday Night",\n\t\t"fcttext":"Showers in the evening, then partly cloudy overnight. Low around 40F. Winds S at 10 to 15 mph. Chance of rain 50%.",\n\t\t"fcttext_metric":"Rain showers early with clearing later at night. Low around 5C. Winds S at 10 to 15 km/h. Chance of rain 50%.",\n\t\t"pop":"50"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":6,\n\t\t"icon":"chancerain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",\n\t\t"title":"Thursday",\n\t\t"fcttext":"Partly cloudy in the morning. Increasing clouds with periods of showers later in the day. High 52F. Winds S at 10 to 20 mph. Chance of rain 40%.",\n\t\t"fcttext_metric":"Partly cloudy early followed by increasing clouds with showers developing later in the day. High 11C. Winds S at 15 to 30 km/h. Chance of rain 40%.",\n\t\t"pop":"40"\n\t\t}\n\t\t,\n\t\t{\n\t\t"period":7,\n\t\t"icon":"nt_mostlycloudy",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif",\n\t\t"title":"Thursday Night",\n\t\t"fcttext":"Partly cloudy skies during the evening will give way to cloudy skies overnight. Low near 40F. Winds SE at 5 to 10 mph.",\n\t\t"fcttext_metric":"Partly cloudy skies early will become overcast later during the night. Low 4C. Winds SSE at 10 to 15 km/h.",\n\t\t"pop":"20"\n\t\t}\n\t\t]\n\t\t},\n\t\t"simpleforecast": {\n\t\t"forecastday": [\n\t\t{"date":{\n\t"epoch":"1489456800",\n\t"pretty":"7:00 PM PDT on March 13, 2017",\n\t"day":13,\n\t"month":3,\n\t"year":2017,\n\t"yday":71,\n\t"hour":19,\n\t"min":"00",\n\t"sec":0,\n\t"isdst":"1",\n\t"monthname":"March",\n\t"monthname_short":"Mar",\n\t"weekday_short":"Mon",\n\t"weekday":"Monday",\n\t"ampm":"PM",\n\t"tz_short":"PDT",\n\t"tz_long":"America/Los_Angeles"\n},\n\t\t"period":1,\n\t\t"high": {\n\t\t"fahrenheit":"53",\n\t\t"celsius":"11"\n\t\t},\n\t\t"low": {\n\t\t"fahrenheit":"47",\n\t\t"celsius":"8"\n\t\t},\n\t\t"conditions":"Rain",\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"skyicon":"",\n\t\t"pop":90,\n\t\t"qpf_allday": {\n\t\t"in": 0.29,\n\t\t"mm": 7\n\t\t},\n\t\t"qpf_day": {\n\t\t"in": null,\n\t\t"mm": null\n\t\t},\n\t\t"qpf_night": {\n\t\t"in": 0.29,\n\t\t"mm": 7\n\t\t},\n\t\t"snow_allday": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_day": {\n\t\t"in": null,\n\t\t"cm": null\n\t\t},\n\t\t"snow_night": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"maxwind": {\n\t\t"mph": 13,\n\t\t"kph": 20,\n\t\t"dir": "SSE",\n\t\t"degrees": 0\n\t\t},\n\t\t"avewind": {\n\t\t"mph": 3,\n\t\t"kph": 5,\n\t\t"dir": "SE",\n\t\t"degrees": 0\n\t\t},\n\t\t"avehumidity": 99,\n\t\t"maxhumidity": 0,\n\t\t"minhumidity": 0\n\t\t}\n\t\t,\n\t\t{"date":{\n\t"epoch":"1489543200",\n\t"pretty":"7:00 PM PDT on March 14, 2017",\n\t"day":14,\n\t"month":3,\n\t"year":2017,\n\t"yday":72,\n\t"hour":19,\n\t"min":"00",\n\t"sec":0,\n\t"isdst":"1",\n\t"monthname":"March",\n\t"monthname_short":"Mar",\n\t"weekday_short":"Tue",\n\t"weekday":"Tuesday",\n\t"ampm":"PM",\n\t"tz_short":"PDT",\n\t"tz_long":"America/Los_Angeles"\n},\n\t\t"period":2,\n\t\t"high": {\n\t\t"fahrenheit":"55",\n\t\t"celsius":"13"\n\t\t},\n\t\t"low": {\n\t\t"fahrenheit":"48",\n\t\t"celsius":"9"\n\t\t},\n\t\t"conditions":"Rain",\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"skyicon":"",\n\t\t"pop":80,\n\t\t"qpf_allday": {\n\t\t"in": 0.40,\n\t\t"mm": 10\n\t\t},\n\t\t"qpf_day": {\n\t\t"in": 0.14,\n\t\t"mm": 4\n\t\t},\n\t\t"qpf_night": {\n\t\t"in": 0.26,\n\t\t"mm": 7\n\t\t},\n\t\t"snow_allday": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_day": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_night": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"maxwind": {\n\t\t"mph": 15,\n\t\t"kph": 24,\n\t\t"dir": "S",\n\t\t"degrees": 187\n\t\t},\n\t\t"avewind": {\n\t\t"mph": 12,\n\t\t"kph": 19,\n\t\t"dir": "S",\n\t\t"degrees": 187\n\t\t},\n\t\t"avehumidity": 95,\n\t\t"maxhumidity": 0,\n\t\t"minhumidity": 0\n\t\t}\n\t\t,\n\t\t{"date":{\n\t"epoch":"1489629600",\n\t"pretty":"7:00 PM PDT on March 15, 2017",\n\t"day":15,\n\t"month":3,\n\t"year":2017,\n\t"yday":73,\n\t"hour":19,\n\t"min":"00",\n\t"sec":0,\n\t"isdst":"1",\n\t"monthname":"March",\n\t"monthname_short":"Mar",\n\t"weekday_short":"Wed",\n\t"weekday":"Wednesday",\n\t"ampm":"PM",\n\t"tz_short":"PDT",\n\t"tz_long":"America/Los_Angeles"\n},\n\t\t"period":3,\n\t\t"high": {\n\t\t"fahrenheit":"52",\n\t\t"celsius":"11"\n\t\t},\n\t\t"low": {\n\t\t"fahrenheit":"40",\n\t\t"celsius":"4"\n\t\t},\n\t\t"conditions":"Rain",\n\t\t"icon":"rain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/rain.gif",\n\t\t"skyicon":"",\n\t\t"pop":90,\n\t\t"qpf_allday": {\n\t\t"in": 0.41,\n\t\t"mm": 10\n\t\t},\n\t\t"qpf_day": {\n\t\t"in": 0.37,\n\t\t"mm": 9\n\t\t},\n\t\t"qpf_night": {\n\t\t"in": 0.04,\n\t\t"mm": 1\n\t\t},\n\t\t"snow_allday": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_day": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_night": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"maxwind": {\n\t\t"mph": 15,\n\t\t"kph": 24,\n\t\t"dir": "SSE",\n\t\t"degrees": 162\n\t\t},\n\t\t"avewind": {\n\t\t"mph": 10,\n\t\t"kph": 16,\n\t\t"dir": "SSE",\n\t\t"degrees": 162\n\t\t},\n\t\t"avehumidity": 89,\n\t\t"maxhumidity": 0,\n\t\t"minhumidity": 0\n\t\t}\n\t\t,\n\t\t{"date":{\n\t"epoch":"1489716000",\n\t"pretty":"7:00 PM PDT on March 16, 2017",\n\t"day":16,\n\t"month":3,\n\t"year":2017,\n\t"yday":74,\n\t"hour":19,\n\t"min":"00",\n\t"sec":0,\n\t"isdst":"1",\n\t"monthname":"March",\n\t"monthname_short":"Mar",\n\t"weekday_short":"Thu",\n\t"weekday":"Thursday",\n\t"ampm":"PM",\n\t"tz_short":"PDT",\n\t"tz_long":"America/Los_Angeles"\n},\n\t\t"period":4,\n\t\t"high": {\n\t\t"fahrenheit":"52",\n\t\t"celsius":"11"\n\t\t},\n\t\t"low": {\n\t\t"fahrenheit":"40",\n\t\t"celsius":"4"\n\t\t},\n\t\t"conditions":"Chance of Rain",\n\t\t"icon":"chancerain",\n\t\t"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",\n\t\t"skyicon":"",\n\t\t"pop":40,\n\t\t"qpf_allday": {\n\t\t"in": 0.02,\n\t\t"mm": 1\n\t\t},\n\t\t"qpf_day": {\n\t\t"in": 0.02,\n\t\t"mm": 1\n\t\t},\n\t\t"qpf_night": {\n\t\t"in": 0.00,\n\t\t"mm": 0\n\t\t},\n\t\t"snow_allday": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_day": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"snow_night": {\n\t\t"in": 0.0,\n\t\t"cm": 0.0\n\t\t},\n\t\t"maxwind": {\n\t\t"mph": 20,\n\t\t"kph": 32,\n\t\t"dir": "S",\n\t\t"degrees": 186\n\t\t},\n\t\t"avewind": {\n\t\t"mph": 13,\n\t\t"kph": 21,\n\t\t"dir": "S",\n\t\t"degrees": 186\n\t\t},\n\t\t"avehumidity": 75,\n\t\t"maxhumidity": 0,\n\t\t"minhumidity": 0\n\t\t}\n\t\t]\n\t\t}\n\t}\n}\n'
In [ ]:
    
    
Content source: rkastilani/PowerOutagePredictor
Similar notebooks: